{include file="header/index" /}
<script charset="utf-8" src="__JS__/editor/kindeditor-all-min.js"></script>
<script charset="utf-8" src="__JS__/editor/lang/zh-CN.js"></script>
<script type="text/javascript" src="__JS__/editor/plugins/code/prettify.js" ></script>
<script>
    KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="content"]', {
            cssPath : "__CSS__/editor/plugins/code/prettify.css",
            uploadJson:'{:url("admin/file/editor")}',
            fileManagerJson: "{:url('admin/file/manager')}",
            allowFileManager : true,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
        prettyPrint();
    });
</script>

<div class="container bgwhite">
    {if condition=" isset($data.announcement_id) "}
        <h2 class="newAnnouncement-title">编辑公告</h2>
    {else/}
        <h2 class="newAnnouncement-title">新增公告</h2>
    {/if}
    {include file="common@public/alert" /}
    <form name="example" method="post" action="{if condition=" isset($data.announcement_id) "}{:url('Announcement/edit','announcement_id='.$data['announcement_id'])}{else /}{:url('Announcement/add')}{/if}">
        <div class="newAnnouncement-center">
            <h3 class="Announce-title">基本信息</h3>
            <div class="Announce-web clearfix">
                <label class="Announce-web-title">标题</label>
                <p class="fl Announce-web-input"><input class="mr20" type="text" value="{$data.title|default=''}" name="title" maxlength="100"/>100字以内</p>
            </div>
            <div class="Announce-web clearfix">
                <label class="Announce-web-title">是否发布</label>
                <p class="fl Announce-web-input">
                    <span class="ml10 mr10"><input class="mr20" {notempty name="data.status"} {eq name="data.status" value="1"} checked="checked" {/eq} {else /} checked="checked" {/notempty} type="radio" value="1" name="status"/>是</span>
                    <span class="ml10 mr10"><input class="mr20" {notempty name="data.status"} {eq name="data.status" value="2"} checked="checked" {/eq} {/notempty} type="radio" value="2" name="status"/>否</span>
                </p>
            </div>
            <div  class="Announce-web clearfix">
                <label class="Announce-web-title" style="margin-top: 150px;">内容</label>
                <p class="fl Announce-web-input"><textarea name="content"  style="width:100%;height:300px;visibility:hidden;">{$data.content|default=''}</textarea></p>
            </div>
        </div>
        <p class="system-bottom-btn">
            <input type="hidden" name="announcement_id" value="{$data.announcement_id|default=''}" />
            <button type="submit" class="system-Determine" name="submit">保存</button>
            <button type="button" onclick="window.history.go(-1)" class="system-Reset">返回</button>
        </p>
    </form>
</div>
</body>
</html>
